﻿using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Xml.Serialization;

namespace CandyMergeTool.Settings
{
    [Serializable]
    public class Settings
    {
        public Settings() { }

        public int NbHorizontalCells { get; set; }
        public int NbVerticalCells { get; set; }

        public int CellWidth { get; set; }
        public int CellHeight { get; set; }

        public int LeftFromStart { get; set; }
        public int TopFromStart { get; set; }

        public List<CandyDefinition> CandyDefinitions { get; set; }

        public static Settings Load()
        {
            var serializer = new XmlSerializer(typeof(Settings));
            using (var reader = new StreamReader("settings.xml"))
                return (Settings)serializer.Deserialize(reader);
        }
    }
}
